let utils = data["utils"];
let STUtil = data["STUtil"];
let Node = data["Node"];
let SplayTree = data["SplayTree"];
let isInBbox = data["isInBbox"];
let getBboxOverlap = data["getBboxOverlap"];
let cmp = data["cmp"];
let crossProduct = data["crossProduct"];
let dotProduct = data["dotProduct"];
let compareVectorAngles = data["compareVectorAngles"];
let sineOfAngle = data["sineOfAngle"];
let cosineOfAngle = data["cosineOfAngle"];
let closestPoint = data["closestPoint"];
let horizontalIntersection = data["horizontalIntersection"];
let verticalIntersection = data["verticalIntersection"];
let intersection = data["intersection"];
let perpendicular = data["perpendicular"];
let rounder = data["rounder"];
let geomIn = data["geomIn"];
let Segment = data["Segment"];

console.log("09PolygonClipping_geom-in03");
function MultiPolyIn(geom, isSubject) {
  this.getSweepEvents = function () {
    const sweepEvents = [];
    for (let i = 0, iMax = this.polys.length; i < iMax; i++) {
      const polySweepEvents = this.polys[i].getSweepEvents();
      for (let j = 0, jMax = polySweepEvents.length; j < jMax; j++) sweepEvents.push(polySweepEvents[j])
    }
    return sweepEvents
  }, this.init = function (geom, isSubject) {
    if (!Array.isArray(geom)) throw new Error("Input geometry is not a valid Polygon or MultiPolygon");
    try {
      "number" == typeof geom[0][0][0] && (geom = [geom])
    } catch (ex) { }
    this.polys = [], this.bbox = {
      ll: {
        x: Number.POSITIVE_INFINITY,
        y: Number.POSITIVE_INFINITY
      },
      ur: {
        x: Number.NEGATIVE_INFINITY,
        y: Number.NEGATIVE_INFINITY
      }
    };
    for (let i = 0, iMax = geom.length; i < iMax; i++) {
      const poly = new geomIn.PolyIn(geom[i], this);
      poly.bbox.ll.x < this.bbox.ll.x && (this.bbox.ll.x = poly.bbox.ll.x), poly.bbox.ll.y < this.bbox.ll.y && (this.bbox.ll.y = poly.bbox.ll.y), poly.bbox.ur.x > this.bbox.ur.x && (this.bbox.ur.x = poly.bbox.ur.x), poly.bbox.ur.y > this.bbox.ur.y && (this.bbox.ur.y = poly.bbox.ur.y), this.polys.push(poly)
    }
    this.isSubject = isSubject
  }, this.init(geom, isSubject)
}
geomIn["MultiPolyIn"] = MultiPolyIn;

return {
  "utils": utils,
  "STUtil": STUtil,
  "Node": Node,
  "SplayTree": SplayTree,
  "isInBbox": isInBbox,
  "getBboxOverlap": getBboxOverlap,
  "cmp": cmp,
  "crossProduct": crossProduct,
  "dotProduct": dotProduct,
  "compareVectorAngles": compareVectorAngles,
  // "length":length,
  "sineOfAngle": sineOfAngle,
  "cosineOfAngle": cosineOfAngle,
  "closestPoint": closestPoint,
  "horizontalIntersection": horizontalIntersection,
  "verticalIntersection": verticalIntersection,
  "intersection": intersection,
  "perpendicular": perpendicular,
  "rounder": rounder,
  "geomIn": geomIn,
  "Segment": Segment
}